﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using DCTLib.Common;
using DCTAccess.Business;

namespace DCTSollution.DCTLib.Common
{
    public class AppConfigurationInfo
    {
        public static string LogRootFolder
        {
            get
            {
                return ConfigurationManager.AppSettings[AppSettingKeys.LOG_ROOT_FOLDER];
            }
        }

        private static bool GetBool(string key, bool defaultValue)
        {
            bool result = false;
            if (bool.TryParse(ConfigurationManager.AppSettings[key], out result))
                return result;
            else
                return defaultValue;
        }

        private static bool GetBool(string key)
        {
            return GetBool(key, false);
        }

        public static bool EnableCaching
        {
            get
            {
                return GetBool(AppSettingKeys.ENABLE_CACHING, false);
            }
        }
    }
}
